package com.feifan.monthhelper.db.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.feifan.monthhelper.bean.db.LivingHabitBean;

import java.util.List;

@Dao
public interface LivingHabitDao {

    @Query("Select * from living_habit")
    List<LivingHabitBean> getAll();

//    @Query("Select * from living_habit Where id In (:videoIds)")
//    List<LivingHabitBean> loadAllByIds(int[] videoIds);

    @Query("Select * from living_habit Where create_date = (:date)")
    LivingHabitBean loadByDate(long date);

    @Insert
    void insertAll(LivingHabitBean... users);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(LivingHabitBean... users);

    @Delete
    void delete(LivingHabitBean... users);

    @Update
    void update(LivingHabitBean... users);

//    @Query("update videobean set id =:videoId where date=:uid")
//    void updateCustom(String videoId, int uid);
}
